<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* .mask{

        } */
    </style>
</head>

<body>
    <div id="app">
        <button v-on:click="show=true">打开</button>
        <div class="mask" v-show="show">
            <span @mouseup="show=false">X</span>
            <p>我是弹窗</p>
        </div>
        
        <ul>
            <li v-for="(item,index) in list" @click="activeIndex=index"
                v-bind:style="{color:activeIndex==index?'red':''}">{{item.title}}</li>
        </ul>
        <div>
            <p v-for="item in list[activeIndex].child">{{item}}</p>
        </div>
    </div>


    <script src="./vue.js"></script>
    <script>
        const vue = new Vue({
            el: "#app",
            data: {
                ele: '你好边伯贤',
                show: false,
                activeIndex: 0,
                list: [{
                    title: '标题1',
                    child: ['杨旭', '情书', '边伯贤', '王荣喜']
                }, {
                    title: '标题2',
                    child: ['账号借钱', '张浩杰', '朴灿烈', '一个亿']
                }, {
                    title: '标题3',
                    child: ['双十一', '依旧', '一个人', '剁手']
                },]
            }
        })
    </script>
</body>

</html>